package testsql;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Q784 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			String str = scanner.nextLine();
			Solution solution = new Q784.Solution();
			System.out.println(solution.letterCasePermutation(str));
		}
	}

	private static class Solution {

		public List<String> letterCasePermutation(String S) {
			if (S.length() != 0) {
				backtrack("", S);
			}
			return output;
		}
		
		List<String> output = new ArrayList<String>();

		public void backtrack(String combination, String next_digits) {
			if (next_digits.length() == 0) {
				output.add(combination);
			} else {
				String letter = next_digits.substring(0, 1);
				if(Character.isDigit(letter.charAt(0))){
					backtrack(combination + letter, next_digits.substring(1));
				}else{
					backtrack(combination + letter.toLowerCase(), next_digits.substring(1));
					backtrack(combination + letter.toUpperCase(), next_digits.substring(1));
				}
			}
		}

		
	}
}
